<?php
/**
 * Created by PhpStorm.
 * User: zoupeng
 * Date: 2019-02-21
 * Time: 22:56
 */

namespace app\index\model;

use think\exception\ErrorException;
use think\Log;
use think\Model;
class Links extends Model
{
    /**
     * 友情链接列表
     * @return false|\PDOStatement|string|\think\Collection
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function findLinksList(){
        try{
            $linksList = $this->where('show',1)->order('id desc')->select();
            return $linksList;
        }catch (ErrorException $e){
            Log::write('获取友情链接数据异常，错误：'.$e->getMessage(),'error');
        }
    }
}